/**
 * 
 */
package org.statewalker.parser.base;

import java.util.HashMap;
import java.util.Map;

import org.statewalker.tokenizer.ITokenizer;

/**
 * @author kotelnikov
 */
public class TokenizerProvider implements ITokenizerProvider {

    private Map<String, ITokenizer> fMap = new HashMap<String, ITokenizer>();

    /**
     * 
     */
    public TokenizerProvider() {
    }

    /**
     * @see org.statewalker.parser.base.ITokenizerProvider#getStateTokenizer(org.statewalker.dict.String)
     */
    public ITokenizer getStateTokenizer(String stateKey) {
        return fMap.get(stateKey);
    }

    public void registerTokenizer(String key, ITokenizer tokenizer) {
        fMap.put(key, tokenizer);
    }

    public void unregisterTokenizer(String key) {
        fMap.remove(key);
    }

}
